function [ resp EMC errorTotal ] = hasLearned( net, trainingPatterns, trainingResults )
%HASLEARNED Summary of this function goes here
%   Detailed explanation goes here
errorTotal = 0;
passed = 0;
EMC = 0;
for i = 1:size(trainingPatterns,1)
    eval = netEvaluate(net, trainingPatterns(i,:));
    train = trainingResults(i,:);
    
    
    ecm = 0;
    pattern_acum_e = 0;
    for j = 1:size(train)
        if(train(j)==0)
            train(j)=-1;
        end
        local_error= abs(eval(j)-train(j));
        pattern_acum_e = pattern_acum_e + local_error;
        ecm = ecm + local_error*local_error;
    end
    EMC = EMC + ecm;
    ecm = sqrt(ecm/j);

    errorTotal = errorTotal + pattern_acum_e;

    if( checkEquals(net, trainingPatterns(i,:), trainingResults(i,:)))
        passed = passed+1;
    end

%     if( isequal(eval, trainingResults(i,:)) )
%         passed = passed+1;
%     end
end
resp = passed;
EMC = sqrt(EMC / i);
end